diff options
author | Valentin Popov <valentin@popov.link> | 2024-09-06 11:21:27 +0300 |
---|---|---|
committer | Valentin Popov <valentin@popov.link> | 2024-09-06 11:21:27 +0300 |
commit | 2f362eaf0937360a0f2a81bac41be81111fa06a8 (patch) | |
tree | c4112b7007de8f2a6dc498b81ab02ab68f126834 /src/pages/blog/[...slug].astro | |
parent | 17c3115a0608bb7ef42c8038b36f24b2356004ec (diff) | |
download | popov.link-2f362eaf0937360a0f2a81bac41be81111fa06a8.tar.xz popov.link-2f362eaf0937360a0f2a81bac41be81111fa06a8.zip |
Added reading time timer
Diffstat (limited to 'src/pages/blog/[...slug].astro')
-rw-r--r-- | src/pages/blog/[...slug].astro | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/pages/blog/[...slug].astro b/src/pages/blog/[...slug].astro index c94fe52..a142db4 100644 --- a/src/pages/blog/[...slug].astro +++ b/src/pages/blog/[...slug].astro @@ -1,6 +1,6 @@ --- import { type CollectionEntry, getCollection } from "astro:content"; -import Layout from "../../layouts/PostLayout.astro"; +import Layout from "../../layouts/PageLayout.astro"; export async function getStaticPaths() { const posts = await getCollection("blog"); @@ -12,9 +12,26 @@ export async function getStaticPaths() { type Props = CollectionEntry<"blog">; const post = Astro.props; -const { Content } = await post.render(); +const { Content, remarkPluginFrontmatter } = await post.render(); --- +<style> + .header { + text-align: center; + } +</style> + <Layout> + <div class="header"> + <h1>Title</h1> + <p> + <small> + Posted + <time datetime="#">#</time> + by Valentin Popov ‐ + <strong>{remarkPluginFrontmatter.minutesRead}</strong> + </small> + </p> + </div> <Content /> </Layout> |